package com.github.dabai.aggregation;

import java.util.Map;

import lombok.Getter;
import lombok.Setter;

@Getter
@Setter
public class AggregationPostField<I extends IAggregatingInput> {
	private String name;
	private IAggregationPost<I> aggregation;
	private Object result;

	public AggregationPostField(String name, Object result, IAggregationPost<I> aggregation) {
		this.name = name;
		this.aggregation = aggregation;
		this.result = result;
	}

	public void aggregating(GroupByKey key, Map<String, AggregationField<I>> aggregations) {
		this.result = aggregation.post(key, aggregations);
	}
}
